﻿/* Write a program that reads from the console a string of maximum 20 characters. 
 * If the length of the string is less than 20, the rest of the characters should be filled with '*'. 
 * Print the result string into the console. */

using System;

namespace _6.Str20ch
{
    class Str20ch
    {
        static void Main()
        {
            char sign = '*';
            string str;
            bool iProvided = false;
            do
            {
                if (iProvided == true) Console.WriteLine("Error: string length exceed 20 chars or no string entered.");
                else iProvided = true;
                Console.Write("Enter a string: ");
                str = Console.ReadLine();
            } while (string.IsNullOrEmpty(str) || str.Length > 20);
            Console.WriteLine(str.PadRight(20, sign));
        }
    }
}
